Advanced database features
One-to-many links
This tutorial demonstrates how to set up an A to B, A to C report using the Customer, Credit, and Orders tables in the Xtreme.mdb sample database. The Xtreme.mdb database is located in the \Program Files\Seagate Software\Crystal Reports\Samples\En\Databases
directory. Use the instructions here as a guideline for creating A to B, A to C reports with your own database files.
To set up an A to B, A to C link
On the Standard toolbar, click New.
- Click As a Blank Report and then OK on the Crystal Report Gallery.
- Expand the Database Files folder.
- Double-click the Xtreme.mdb database file to see its tables.
- Highlight the Credit table and click Add.
- Repeat the previous step for both the Customer and Orders tables.
- When all three tables have been added, click Close on the Data Explorer
dialog box.
The Visual Linking Expert appears.
- If the tables are linked by default, click Clear Links.
- Link the Customer Credit ID field in the Credit table to the Customer ID field in each of the other two tables.
- Select one of the links in the Visual Linking Expert and click Link Options.
The Link Options dialog box appears.
Note: Only the link options on the left of the dialog box apply to native connections.
- Click Look up all of one, then all of others in the When linking to two files from this file section of the Link Options dialog box.
This option establishes an A to B, A to C link.
- Click OK to return to the Visual Linking Expert.
The option you selected affected all links.
- To make sure the correct link option is in effect, click the link line that you did not select in the last step.
- Click Link Options, and verify the Look up all of one, then all of others setting in the Link Options dialog box.
- Click OK in the Link Options dialog box, then click OK again back in the Visual Linking Expert.
For more information about this type of linking, see Look up all of one, then all of others (A to B, A to C).
You have now established an A to B, A to C relationship among the three tables.